<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/12/26 0026
  Time: 9:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<head>
    <title>服务标签</title>
</head>
<body>
<script>
    var SellerserveLabelList="${sellerserveLabelList}";
    if(SellerserveLabelList.length){
        SellerserveLabelList = SellerserveLabelList.substring(1,SellerserveLabelList.length-1).split(",");
        SellerserveLabelList.map(function(ele,index){
            $("#SellerServeLabel input[value='"+ele.trim()+"']").attr("checked","checked");
        });
    }
    //保存
    function checkSellerServeLabel(){
        progressLoad();
        $.ajax({
            cache: true,
            type: "POST",
            url:"${path }/seller/editSellerServeLabel.do",
            data:$('#SellerServeLabel').serialize(),// 你的formid
            async: false,
            error: function(request) {
                progressClose();
                $.messager.alert("删除失败", "服务器连接失败!","error");
            },
            success: function(data) {
                progressClose();
                if (data.success) {
                    $.messager.alert("系统提示", "操作成功","info",function(){
                        closeWin('editServeLabel')
                        reloadSellerDataGrid();
                    });

                }else{
                    progressClose();
                    $.messager.alert("系统提示", data.msg,"error");
                }
            }
        });
    }

</script>

<div>
    <form id="SellerServeLabel" action="">

        <table  border="1" width="100%" cellpadding="0" cellspacing="0">
            <c:forEach var="sl"   items="${serveLabelList}"   >
            <tr>
                <td width="10%" style="text-align: center"><input type="checkbox" name="serveLabelList" value="${sl.id}_${sl.ord}"></td><td style="padding: 10px">${sl.name}</td>
            </tr>
            </c:forEach>
        </table>
        <input type="hidden" value="${seller.id}" id="sellerId " name="sellerId">
    </form>
</div>

<div  data-options="region:'south',border:true" style="height: 24px; padding-top: 8px;text-align: center" >
    <a  class="easyui-linkbutton" icon="icon-save" onclick="checkSellerServeLabel();" >保存</a>
    <a class="easyui-linkbutton" icon="icon-cancel" onclick="closeWin('editServeLabel')" >取消</a>
</div>
</body>
</html>
